import homework.*;
import org.junit.jupiter.api.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class test
{
    @Test
    void testSetter03() {
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("applicationContext.xml");
        Question question = applicationContext.getBean("question", Question.class);
        question.display();
    }

    @Test
    void testAnnotationSection(){
        ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
        TextEditor textEditor = context.getBean("textEditor", TextEditor.class);
        textEditor.spellCheck();
    }

    @Test
    void testJavaAnnotationSection01() {
        ApplicationContext context = new AnnotationConfigApplicationContext(HelloWorldConfig.class);
        HelloWorld bean = context.getBean(HelloWorld.class);
        bean.setMessage("Hello Java!");
        bean.display();
    }

}
